package com.software.modelcenter.repository;

import com.software.modelcenter.entity.ModelMine;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;

/**
 *
 */

@Repository
public interface ModelMineRepository extends JpaRepository<ModelMine, String>{

    @Query("select m from ModelMine m where m.userId=?1 order by m.userId")
    List<ModelMine> ListModelMineById(String userId);

    @Query("select count(m) from ModelMine m where m.userId=?1")
    int getCount(String userId);

    void deleteByModelId(String modelId);
}
